#pragma once

#include "GLSupervisor.hpp"

#if MICROPROFILE_ENABLED == 1
#include <microprofile.h>

//////////////////////////
// Microprofile enabled //
//////////////////////////

#define PROFILER_SCOPE_AUDIO(NAME) MICROPROFILE_SCOPEI("Audio", NAME, MP_VIOLETRED); GL_SUPERVISOR_SCOPE();
#define PROFILER_SCOPE_AUDIO_FN() MICROPROFILE_SCOPEI("Audio", __PRETTY_FUNCTION__, MP_VIOLETRED); GL_SUPERVISOR_SCOPE();

#define PROFILER_SCOPE_INPUT(NAME) MICROPROFILE_SCOPEI("Input", NAME, MP_GRAY); GL_SUPERVISOR_SCOPE();
#define PROFILER_SCOPE_INPUT_FN() MICROPROFILE_SCOPEI("Input", __PRETTY_FUNCTION__, MP_GRAY); GL_SUPERVISOR_SCOPE();

#define PROFILER_SCOPE_IO(NAME) MICROPROFILE_SCOPEI("I/O", NAME, MP_LIGHTBLUE); GL_SUPERVISOR_SCOPE();
#define PROFILER_SCOPE_IO_FN() MICROPROFILE_SCOPEI("I/O", __PRETTY_FUNCTION__, MP_LIGHTBLUE); GL_SUPERVISOR_SCOPE();

#define PROFILER_SCOPE_MISC(NAME) MICROPROFILE_SCOPEI("Misc.", NAME, MP_LIGHTYELLOW); GL_SUPERVISOR_SCOPE();
#define PROFILER_SCOPE_MISC_FN() MICROPROFILE_SCOPEI("Misc.", __PRETTY_FUNCTION__, MP_LIGHTYELLOW); GL_SUPERVISOR_SCOPE();

#define PROFILER_SCOPE_PHYSICS(NAME) MICROPROFILE_SCOPEI("Physics", NAME, MP_DARKSLATEBLUE); GL_SUPERVISOR_SCOPE();
#define PROFILER_SCOPE_PHYSICS_FN() MICROPROFILE_SCOPEI("Physics", __PRETTY_FUNCTION__, MP_DARKSLATEBLUE); GL_SUPERVISOR_SCOPE();

#define PROFILER_SCOPE_RENDER(NAME) MICROPROFILE_SCOPEI("Rendering", NAME, MP_LIGHTGREEN); GL_SUPERVISOR_SCOPE();
#define PROFILER_SCOPE_RENDER_FN() MICROPROFILE_SCOPEI("Rendering", __PRETTY_FUNCTION__, MP_LIGHTGREEN); GL_SUPERVISOR_SCOPE();

#else

///////////////////////////
// Microprofile disabled //
///////////////////////////

#define PROFILER_SCOPE_AUDIO(NAME); GL_SUPERVISOR_SCOPE();
#define PROFILER_SCOPE_AUDIO_FN(); GL_SUPERVISOR_SCOPE();

#define PROFILER_SCOPE_INPUT(NAME); GL_SUPERVISOR_SCOPE();
#define PROFILER_SCOPE_INPUT_FN(); GL_SUPERVISOR_SCOPE();

#define PROFILER_SCOPE_IO(NAME); GL_SUPERVISOR_SCOPE();
#define PROFILER_SCOPE_IO_FN(); GL_SUPERVISOR_SCOPE();

#define PROFILER_SCOPE_MISC(NAME); GL_SUPERVISOR_SCOPE();
#define PROFILER_SCOPE_MISC_FN(); GL_SUPERVISOR_SCOPE();

#define PROFILER_SCOPE_PHYSICS(NAME); GL_SUPERVISOR_SCOPE();
#define PROFILER_SCOPE_PHYSICS_FN(); GL_SUPERVISOR_SCOPE();

#define PROFILER_SCOPE_RENDER(NAME); GL_SUPERVISOR_SCOPE();
#define PROFILER_SCOPE_RENDER_FN(); GL_SUPERVISOR_SCOPE();

#endif
